package com.springboot.study.tests.designpattern.decoreator2;

/**
 * @Author: guodong
 * @Date: 2021/5/6 11:00
 * @Version: 1.0
 * @Description:
 */
public class BattercakeDecotator extends Battercake{

    //静态代理，委派
    //(指定抽象类 而不指定BaseBattercake 实体是为了灵活,
    //因为可能以后会有多个类似BaseBattercake 继承了Battercake 的实现类)
    private Battercake battercake;

    public BattercakeDecotator(Battercake battercake) {
        this.battercake = battercake;
    }

    @Override
    protected String getMsg() {
        return battercake.getMsg();
    }

    @Override
    protected int getPrice() {
        return battercake.getPrice();
    }

}
